<template>
    <div class="app-container">
      <el-card>
        <el-table v-loading="loading" :data="infoList" border @row-dblclick="getPicAndVideo">
          <el-table-column label="人员ID" align="center" prop="constructionId" />
          <el-table-column label="人员姓名" align="center" prop="constructionName" :show-overflow-tooltip="true" />
          <el-table-column label="供应商" align="center" prop="supplierInfo.supplierName" :show-overflow-tooltip="true" />
          <el-table-column label="类别信息" align="center" prop="team.teamName" :show-overflow-tooltip="true" />
          <el-table-column label="价格" align="center" prop="price" :show-overflow-tooltip="true" />
          <el-table-column label="队伍人数" align="center" prop="teamNumber" :show-overflow-tooltip="true" />
          <el-table-column label="状态" align="center">
            <template slot-scope="scope">
              <el-tag type="danger" v-if="scope.row.publishStatus == '1'">禁用</el-tag>
              <el-tag type="success" v-else-if="scope.row.publishStatus == '0'">启用</el-tag>
            </template>
          </el-table-column>
          <el-table-column label="审核状态" align="center">
            <template slot-scope="scope">
              <el-tag type="danger" v-if="scope.row.auditStatus == '1'">未审核</el-tag>
              <el-tag type="success" v-else-if="scope.row.auditStatus == '0'">已审核</el-tag>
            </template>
          </el-table-column>
          <el-table-column label="描述" align="center" prop="descript" :show-overflow-tooltip="true" />
          <el-table-column label="最后修改时间" align="center" prop="modifiedTime" width="180">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.modifiedTime, '{y}-{m}-{d}') }}</span>
            </template>
          </el-table-column>
        </el-table>
        <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
      </el-card>
    </div>
</template>

<script>

  import {
    listSuperTeamInfo,
  } from "@/api/super/superTeamSupplier";


  export default {
    name: "index",
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 用户表格数据
        infoList: null,
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 日期范围
        dateRange: [],
        // 状态数据字典
        statusOptions: [],
        // 类别选项
        teamOptions: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          teamId: null,
        },
        // 类别ID
        teamId: null,
        // 表单参数
        form: {},
        defaultProps: {
          children: "children",
          label: "label",
        },
      };
    },
    created() {
      let teamId = parseInt(this.$route.query.teamId);
      this.teamId = teamId;
      this.getList(teamId);
      this.getDicts("sys_normal_disable").then((response) => {
        this.statusOptions = response.data;
      });
    },
    methods: {
      /** 查询施工队图片和视频列表 */
      getPicAndVideo(row){
        this.$router.push({path:"/superOrderTeam/orderTeam",query:{constructionId:row.constructionId}});
      },
      /* 查询类别列表 **/
      getList(teamId){
        this.loading = true;
        this.queryParams.teamId = teamId;
        listSuperTeamInfo(this.queryParams).then(response => {
          this.infoList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
    }
  }
</script>

<style scoped>

</style>
